---
layout: m1x_soap
title: Sales Order Invoice
---
				    
<h2><a name="MAPI-Invoice-Module%3AMageSales"></a>Module: Mage_Sales</h2>

<p>The Mage_Sales module allows you to manage sales orders, invoices, shipments, and credit memos.</p>

<h4><a name="MAPI-Invoice-Invoice"></a>Invoice</h4>

<p>Allows you to manage invoices.</p>

<p><b>Resource Name</b>: sales_order_invoice</p>

<p><b>Aliases</b>:</p>
<ul>
	<li>order_invoice</li>
</ul>


<p><b>Methods</b>:</p>
<ul>
	<li><a href="sales_order_invoice.list.html" title="sales_order_invoice.list">sales_order_invoice.list</a><font color="#000000">&nbsp;&#45; Retrieve a list of invoices using filters</font></li>
	<li><a href="sales_order_invoice.info.html" title="sales_order_invoice.info">sales_order_invoice.info</a><font color="#000000">&nbsp;&#45; Retrieve information about the invoice</font></li>
	<li><a href="sales_order_invoice.create.html" title="sales_order_invoice.create">sales_order_invoice.create</a><font color="#000000">&nbsp;&#45; Create a new invoice for an order</font></li>
	<li><a href="sales_order_invoice.addComment.html" title="sales_order_invoice.addComment">sales_order_invoice.addComment</a><font color="#000000">&nbsp;&#45; Add a new comment to an invoice</font></li>
	<li><a href="sales_order_invoice.capture.html" title="sales_order_invoice.capture">sales_order_invoice.capture</a><font color="#000000">&nbsp;&#45; Capture an invoice</font></li>
	<li><a href="sales_order_invoice.cancel.html" title="sales_order_invoice.cancel">sales_order_invoice.cancel</a><font color="#000000">&nbsp;&#45; Cancel an invoice</font></li>
</ul>


<h4><a name="MAPI-Invoice-Faults"></a>Faults</h4>


<table><tbody>
<tr>
<th> <font color="#555555">Fault Code</font> </th>
<th> <font color="#555555">Fault Message</font> </th>
</tr>
<tr>
<td> <font color="#555555">100</font> </td>
<td> <font color="#555555">Requested shipment does not exists.</font> </td>
</tr>
<tr>
<td> <font color="#555555">101</font> </td>
<td> <font color="#555555">Invalid filters given. Details in error message.</font> </td>
</tr>
<tr>
<td> <font color="#555555">102</font> </td>
<td> <font color="#555555">Invalid data given. Details in error message.</font> </td>
</tr>
<tr>
<td> <font color="#555555">103</font> </td>
<td> <font color="#555555">Requested order does not exists</font> </td>
</tr>
<tr>
<td> <font color="#555555">104</font> </td>
<td> <font color="#555555">Invoice status not changed.</font> </td>
</tr>
</tbody></table>


<h4><a name="MAPI-Invoice-Examples"></a>Examples</h4>

<h5><a name="MAPI-Invoice-Example1.Basicworkingwithinvoices."></a>Example 1. Basic working with invoices.</h5>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: java; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');

$notInvoicedOrderId  = '100000003';

// Create new invoice
$newInvoiceId = $proxy-&gt;call($sessionId, 'sales_order_invoice.create', array($notInvoicedOrderId, array(), 'Invoice Created', true, true));

// View new invoice
$invoice = $proxy-&gt;call($sessionId, 'sales_order_invoice.info', $newInvoiceId);

var_dump($invoice);

// Add Comment
$proxy-&gt;call($sessionId, 'sales_order_invoice.addComment', array($newInvoiceId, 'Invoice comment, some text', true, false));

// View invoice with new comment
$invoice = $proxy-&gt;call($sessionId, 'sales_order_invoice.info', $newInvoiceId);

var_dump($invoice);

$proxy-&gt;call($sessionId, 'sales_order_invoice.capture', $newInvoiceId);

// View captured invoice
$invoice = $proxy-&gt;call($sessionId, 'sales_order_invoice.info', $newInvoiceId);
var_dump($invoice);</pre>
		</div>
</div></div>

				    
Create the Magento file system owner                   			    
